package com.yanqu.road.entity.activity.lottery;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_c_activity_lottery_box", desc = "通用抽奖")
public class ActivityLotteryBox extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "已抽隐藏款盲盒数量")
    private int count;

    @FieldTypeAnnotation(desc = "最后修改时间")
    private long lastUpdateTime;

    @FieldTypeAnnotation(desc = "中将玩家")
    private List<Long> userList = new ArrayList<>();

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        if(this.count != count) {
            this.count = count;
            setUpdateOption();
        }
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        if(this.lastUpdateTime != lastUpdateTime) {
            this.lastUpdateTime = lastUpdateTime;
            setUpdateOption();
        }
    }

    public List<Long> getUserList() {
        return userList;
    }

    public void setUserList(List<Long> userList) {
        this.userList = userList;
        setUpdateOption();
    }

    public void addUser(long userId){
        this.userList.add(userId);
        setUpdateOption();
    }
}
